﻿<!doctype html>
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>jQuery Barcode</title>
		<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.slim.min.js"></script>
		<script type="text/javascript" src="jquery-barcode.js"></script>
		<style type="text/css">
		.barcodeImg{margin:10px 0px}
		</style>
	</head>
	<body>

           code11 code13 code9 code128 mix
        	<div style="margin:10px">	

			<input id="src" value="619878702156"></input><br/>				
			<input type="button" onclick='genCodeBar()' value="生成条形码"> 	
			
			<div id="bcTarget" class="barcodeImg"></div>			
		</div>

		<script type="text/javascript">


		function genCodeBar(){
			// 生成条形码的值
			var codeVal=$("#src").val();
			$("#bcTarget").empty().barcode(codeVal, "code128",{barWidth:1, barHeight:30,showHRI:false});
		}

		</script>

	</body>
</html>